<!DOCTYPE html>
<html>
{include file='/common/_meta'}
<body>
	<!-- 头部 -->
{include file='/common/top'}
	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			            <!-- Page Sidebar -->
                {include file='/common/left'}
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <a href="{:url('Index/index')}">系统</a>
                        </li>
                        <li class="active">商品管理</li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    
<button type="button" tooltip="添加用户" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{:url('commodity/add')}'"> <i class="fa fa-plus"></i> 添加商品
</button>
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-body">
                <div class="flip-scroll">
                    <table class="table table-bordered table-hover">
                        <thead class="">
                            <tr>
                                <th class="text-center" width="10%">ID</th>
                                <th class="text-center">名称</th>
                                <th class="text-center" width="10%">编号</th>
                                <th class="text-center" width="6%">缩略图</th>
                                <th class="text-center" width="6%">市场价</th>
                                <th class="text-center" width="6%">本店价</th>
                                <th class="text-center" width="6%">上架</th>
                                <th class="text-center" width="6%">栏目</th>
                                <th class="text-center" width="6%">品牌</th>
                                <th class="text-center" width="6%">类型</th>
                                <th class="text-center" width="6%">重量</th>
                                <th class="text-center" width="4%">单位</th>
                                <th class="text-center" width="14%">操作</th>
                            </tr>
                        </thead>
                        
                        {volist name="commRes" id="comms"}
                        <tbody>
                            <tr>
                                <td align="center">{$comms.commodity_id}</td>
                                <td align="center">{$comms.commodity_name}</td>
                                <td align="center">{$comms.commodity_code}</td>
                                <td align="center">
                                    {if condition="$comms.commodity_ogthumb neq ''"}
                                        <img src="__upload__/{$comms.commodity_ogthumb}" alt="" style="width: 100%" />
                                    {else}
                                        无缩略图
                                    {/if}
                                </td>
                                <td align="center">{$comms.commodity_market_price}</td>
                                <td align="center">{$comms.commodity_shop_price}</td>
                                <td align="center">
                                    {if condition="$comms.commodity_on_sale eq 1"}
                                        上架
                                    {else}
                                        下架
                                    {/if}
                                </td>
                                <td align="center">
                                    {if condition="$comms.cates_name neq ''"}
                                        {$comms.cates_name}
                                    {else}
                                        未设置
                                    {/if}
                                </td>
                                <td align="center">
                                    {if condition="$comms.brand_name neq ''"}
                                        {$comms.brand_name}
                                    {else}
                                        未设置
                                    {/if}
                                </td>
                                <td align="center">
                                    {if condition="$comms.type_name neq ''"}
                                        {$comms.type_name}
                                    {else}
                                        未设置
                                    {/if}
                               </td>
                                <td align="center">{$comms.commodity_weight}</td>
                                <td align="center">{$comms.commodity_weight_unit}</td>
                                <td align="center">
                                    <a href="{:url('commodity/product',array('commodity_id'=>$comms['commodity_id']))}" class="btn btn-sm btn-warning shiny">
                                        <i class="fa fa-check-square-o"></i> 库存
                                    </a>
                                    <a href="{:url('edit',array('commodity_id'=>$comms['commodity_id']))}" class="btn btn-primary btn-sm shiny">
                                        <i class="fa fa-edit"></i> 编辑
                                    </a>
                                    <a href="#" onClick="warning('确实要删除吗', '{:url('del',array('commodity_id'=>$comms['commodity_id']))}')" class="btn btn-danger btn-sm shiny">
                                        <i class="fa fa-trash-o"></i> 删除
                                    </a>
                                </td>
                            </tr>
                        </tbody>
                        {/volist}
                    </table>
                </div>
                <div> 
                    {$commRes->render()}
              	</div>
            </div>
        </div>
    </div>
</div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

	    <!--Basic Scripts-->
    {include file='/common/footer'}    


</body></html>